home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-01 | 5.2 KB | 268 lines | [TEXT/MPS ] |
- /*------------------------------------------------------------------------------
- #
- # TaskSample.r
- #
- # derived from MPW 3.1's "TaskSample", a MultiFinder-Aware Simple Sample Application
- #
- # Demostrates how to port A/ROSE tasks to the MacOS under MultiFinder
- #
- # Refer to the original source code in the MPW CExamples folder for more comments
- #
- # Components:
- # TaskSample.c
- # TaskSample.r
- # TaskSample.h
- # TaskSample.make
- #
- ------------------------------------------------------------------------------*/
-
-
- #include "Types.r"
-
- #include "TaskSample.h"
-
-
-
- resource 'MBAR' (rMenuBar, preload) {
- { mApple, mFile, mEdit, mSleep};
- };
-
-
- resource 'MENU' (mApple, preload) {
- mApple, textMenuProc,
- AllItems & ~MenuItem2, /* Disable dashed line, enable About and DAs */
- enabled, apple,
- {
- "About TaskSample…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mFile, preload) {
- mFile, textMenuProc,
- MenuItem12, /* enable Quit only, program enables others */
- enabled, "File",
- {
- "New",
- noicon, "N", nomark, plain;
- "Open",
- noicon, "O", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Close",
- noicon, "W", nomark, plain;
- "Save",
- noicon, "S", nomark, plain;
- "Save As…",
- noicon, nokey, nomark, plain;
- "Revert",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Page Setup…",
- noicon, nokey, nomark, plain;
- "Print…",
- noicon, nokey, nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Quit",
- noicon, "Q", nomark, plain
- }
- };
-
- resource 'MENU' (mEdit, preload) {
- mEdit, textMenuProc,
- NoItems, /* disable everything, program does the enabling */
- enabled, "Edit",
- {
- "Undo",
- noicon, "Z", nomark, plain;
- "-",
- noicon, nokey, nomark, plain;
- "Cut",
- noicon, "X", nomark, plain;
- "Copy",
- noicon, "C", nomark, plain;
- "Paste",
- noicon, "V", nomark, plain;
- "Clear",
- noicon, nokey, nomark, plain
- }
- };
-
- resource 'MENU' (mSleep, preload) {
- mSleep, textMenuProc,
- allEnabled,
- enabled, "SleepTime",
- {
- "no Sleep",
- noicon, nokey, nomark, plain;
- "60 Ticks",
- noicon, nokey, check, plain;
- }
- };
-
-
-
- /* this ALRT and DITL are used as an About screen */
-
- resource 'ALRT' (rAboutAlert, purgeable) {
- {40, 20, 160, 320},
- rAboutAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
- resource 'DITL' (rAboutAlert, purgeable) {
- { /* array DITLarray: 5 elements */
- /* [1] */
- {88, 200, 108, 290},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {8, 8, 24, 290},
- StaticText {
- disabled,
- "A/ROSE Task under MultiFinder"
- },
- /* [3] */
- {32, 8, 48, 290},
- StaticText {
- disabled,
- "(derived from MPW:CExamples:Sample)"
- },
- /* [4] */
- {56, 8, 72, 136},
- StaticText {
- disabled,
- "Brought to you by:"
- },
- /* [5] */
- {80, 24, 112, 167},
- StaticText {
- disabled,
- "Joseph Maurer (EURO.DTS)"
- }
- }
- };
-
-
- /* this ALRT and DITL are used as an error screen */
-
- resource 'ALRT' (rUserAlert, purgeable) {
- {40, 250, 160, 510},
- rUserAlert,
- { /* array: 4 elements */
- /* [1] */
- OK, visible, silent,
- /* [2] */
- OK, visible, silent,
- /* [3] */
- OK, visible, silent,
- /* [4] */
- OK, visible, silent
- }
- };
-
-
- resource 'DITL' (rUserAlert, purgeable) {
- { /* array DITLarray: 3 elements */
- /* [1] */
- {80, 150, 100, 230},
- Button {
- enabled,
- "OK"
- },
- /* [2] */
- {10, 60, 60, 230},
- StaticText {
- disabled,
- "^0."
- },
- /* [3] */
- {8, 8, 40, 40},
- Icon {
- disabled,
- 2
- }
- }
- };
-
- resource 'STR ' (rTaskName, purgeable) {
- "myTaskName"
- };
-
- resource 'STR ' (rTaskType, purgeable) {
- "myTaskType"
- };
-
-
- resource 'STR#' (rErrStrings, purgeable) {
- {
- "You must run on 512Ke or later";
- "Application Memory Size is too small";
- "Not enough memory to run TaskSample";
- "Cannot create window";
- "Cannot use A/ROSE Prep";
- "Task already registered";
- "<GetMsg> failed";
- "No Server task found";
- "Problem with ICC Manager";
- "Received message with unknown mCode";
- "Received undeliverable message";
- }
- };
-
- resource 'STR#' (rWndStrings, purgeable) {
- {
- "OpenQueue returned: $";
- "(this is my TID !)";
- " Messages received: ";
- " ............ sent: ";
- }
- };
-
-
- resource 'WIND' (rWindow, preload, purgeable) {
- {40, 260, 220, 500},
- noGrowDocProc, visible, noGoAway, 0x0, "TaskSample"
- };
-
-
-
- /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
-
- resource 'SIZE' (-1) {
- dontSaveScreen,
- acceptSuspendResumeEvents,
- enableOptionSwitch,
- canBackground, /* we can background; we don't currently, but our sleep value */
- /* guarantees we don't hog the Mac while we are in the background */
- multiFinderAware, /* this says we do our own activate/deactivate; don't fake us out */
- backgroundAndForeground, /* this is definitely not a background-only application! */
- dontGetFrontClicks, /* change this is if you want "do first click" behavior like the Finder */
- ignoreChildDiedEvents, /* essentially, I'm not a debugger (sub-launching) */
- not32BitCompatible, /* this app should not be run in 32-bit address space */
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- reserved,
- kPrefSize * 1024,
- kMinSize * 1024
- };
-